<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<div class="row">
    <div class="box col-md-12">
        <div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> Add Divisions</h2>

               
            </div>
            <div class="box-content">
                <form role="form" action="UpdateDivisionAction.do" method="post">

                    <input type="hidden" name="id" value="${applicationScope.detail_division.id}">
                    <div class="form-group">
                        <label for="exampleInputEmail1">Division name</label>
                        <input type="text" name="name" value="${applicationScope.detail_division.name}" class="form-control" id="exampleInputEmail1" placeholder="Enter Division Name" >
                        <span style="color: #91170a;font-family: serif;font-size: 14px" id="division_error_txt"><html:errors property="name" ></html:errors></span>
                        </div>

                        <div class="form-group">
                            <label for="exampleInputEmail1">Semester</label>
                            <select name="semester">
                            <c:forEach var="i" begin="1" end="8">
                                <c:choose>
                                    <c:when test="${applicationScope.detail_division.semester eq i}">
                                        <option selected="true" value="${i}"><c:out value="${i}"/></option>
                                    </c:when>
                                    <c:otherwise>
                                        <option><c:out value="${i}"/></option>
                                    </c:otherwise>

                                </c:choose>

                            </c:forEach>

                        </select>
                    </div>

                    <div class="form-group">
                        <label for="exampleInputEmail1">Branch</label>
                        <select name="bid">

                            <c:forEach var="branch" items="${applicationScope.li_allbranches}">
                                
                                <c:choose>
                                    <c:when test="${applicationScope.detail_division.branch.name eq branch.name}">
                                        <option selected="true" value="${branch.id}"><c:out value="${branch.name}"/></option>
                                        
                                    </c:when>
                                    <c:otherwise>
                                        <option value="${branch.id}">${branch.name}</option>
                                    </c:otherwise>
                                </c:choose>
                               
                            </c:forEach>

                        </select>
                    </div>
                    <input type="hidden" name="addedby" value="${sessionScope.admin.id}">

                    <div class="form-group">
                        <button type="submit" class="btn btn-default">Submit</button>
                </form>


            </div>
        </div>
        <!--/span-->

    </div><!--/row-->

    <!-- content ends -->
</div><!--/#content.col-md-0-->
</div>